-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable MBT tests if the "mocks" feature is not enabled #643
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense. Thanks Vitor for the quick turnaround!
Could you also take care of the Changelog?
Codecov Report
@@ Coverage Diff @@
## master #643 +/- ##
=========================================
+ Coverage 13.6% 46.4% +32.7%
=========================================
Files 69 152 +83
Lines 3752 10165 +6413
Branches 1374 0 -1374
=========================================
+ Hits 513 4722 +4209
- Misses 2618 5443 +2825
+ Partials 621 0 -621
Continue to review full report at Codecov.
|
Done in 361e046. There were two entries for BUG FIXES; I also fixed that. |
…ems#643) * Add structure to MBT * Only run model_based test if mocks feature is enabled * Remove model_based test from the executor * update CHANGELOG
Closes: #642
Description
Before, running
cargo test
in the root folder would run the MBT tests successfully. However, runningcargo test
inside themodules/
folder doesn't work because the"mocks"
is missing. This hints that runningcargo test
in the root folder is equivalent to runningcargo test --all-features
, but I couldn't find the corresponding documentation.Ideally we would like to always enable the
"mocks"
feature when running tests, independently from where, but unfortunately this seems to not be supported: rust-lang/cargo#2911This PR disables the MBT tests if the "mocks" feature is not enabled, which seemed to be the best workaround suggested in the previous issue: rust-lang/cargo#2911 (comment)
Now, running
cargo test
in the root folder still runs the MBT tests successfully, while runningcargo test
inside themodules/
folder simply ignores them. To also run the MBT tests inside themodules/
folder one has to:cargo test --features mocks
This PR also adds more structure to the MBT tests, as suggested by @adizere in #601 (comment). This is a good suggestion since each file in the
tests/
folder is compiled as it own crate. As a result,step.rs
,modelator.rs
andmodel_based.rs
were all compiled individually, even though only the latter had a test in it.model_based.rs
was renamed tombt.rs
just to minimize the diff in this PR.For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.